Repository navigation
Conversation
Enterprise Vault deployments can route API requests through an extra path prefix immediately after /v1/. Add an optional api_path_prefix setting to the Vault credential driver that inserts this prefix in the shared URL builder, covering Kubernetes auth login, token_file KV operations, KV v1 and v2 reads/writes, and metadata deletion. The prefix applies to request URLs only: logical secret paths and persisted credential handles never include it, so handles remain resolvable across restarts. Configuration validation rejects empty and unsafe path segments. Expose api_path_prefix through the standalone driver CLI (--api-path-prefix / OPENSHELL_VAULT_API_PATH_PREFIX), Helm legacy values (apiPathPrefix), and gatewayConfig passthrough. Closes ai-openshell#5818 Signed-off-by: laik <laik.lj@me.com>
|
All contributors have signed the DCO ✍️ ✅ |
Author
|
I have read the DCO document and I hereby sign the DCO. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an optional
api_path_prefixsetting to the Vault credential driver for enterprise Vault deployments that route API requests through an extra path prefix immediately after/v1/. The prefix is inserted in the shared URL builder, so it covers every current driver request without touching logical secret paths or persisted credential handles. Field naming follows maintainer feedback on the issue (api_path_prefixoverlob).Related Issue
Closes #5818
Changes
crates/openshell-driver-vault: optionalapi_path_prefixconfig field, validated with the same safe-path rules asmount(rejects empty values,./..segments, empty segments, and unsafe characters).url_for_pathinserts it immediately after/v1/for Kubernetes auth login, KV v1/v2 reads and writes, and KV v2 metadata deletion, under bothkubernetesandtoken_fileauth. Handles stayv1:<logical-path>and never include the prefix.--api-path-prefix/OPENSHELL_VAULT_API_PATH_PREFIXfor out-of-process UDS deployments.server.credentialDrivers.vault.apiPathPrefixlegacy value mapped intogateway.toml;gatewayConfig.openshell.credential_drivers.vault.api_path_prefixpasses through unchanged. Chart README regenerated.docs/how-it-works/gateways/configuration.mdxdescribesapi_path_prefixbehavior and handle compatibility.skills/debug-openshell-cluster: Vault troubleshooting note for prefix-routing 404s.Example:
produces
POST /v1/business-unit/auth/kubernetes/loginandGET /v1/business-unit/secret/data/<path>. Withapi_path_prefixomitted, every URL is byte-for-byte identical to before.Release Notes
The Vault credential driver supports enterprise deployments that route API requests through a path prefix after
/v1/. Setapi_path_prefixin the Vault driver configuration; existing deployments are unaffected.Testing
What ran:
cargo test -p openshell-driver-vault: 33 passed, 0 failed, 1 ignored. New tests cover settings parsing (kubernetes + token_file), invalid-prefix rejection, exact URL construction with and without the prefix, wiremock-level Kubernetes auth login + KV v2 read through the prefixed paths, token_file KV v2 store/resolve/delete with a fresh driver instance resolving the stored handle (restart compatibility), and token_file KV v1 store/resolve.cargo clippy -p openshell-driver-vault --all-targets: no warnings;cargo fmt --check: clean.helm unittest deploy/helm/openshell: 35 suites, 501 tests passed, including new legacy-value andgatewayConfigpassthrough rendering tests and a no-prefix regression guard on the default Vault rendering.deploy/helm/test-gateway-config-parser.sh: rendered gateway TOML passed Rust loader validation.helm-docsdry-run diff: chart README in sync.markdownlint-cli2on changed Markdown/MDX: clean.The Kubernetes credential-drivers E2E lane was not run: the change adds an optional field that is absent from existing fixtures, and the default URL construction is asserted unchanged by unit tests. Happy to run the lane if maintainers want it.
Checklist